package com.sinosoft.sinopay.apiservice.wechat.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 【微信配置工具类】
 * @author chihouliang
 * @date 2016年9月20日 上午10:41:37 
 * @version V1.0
 */
public abstract class WechatConfig {
   
    /**微信统一下单地址*/
    public static final String ORDER_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
    /**微信授权地址：获取code的地址*/
    public static final String AUTHORIZE_URL="https://open.weixin.qq.com/connect/oauth2/authorize";
    /**微信授权地址：获取access_token 和 openId地址*/
    public static final String TOKEN_URL="https://open.weixin.qq.com/connect/oauth2/authorize";

    /**获取微信配置属性方法*/
    public static String getProperty(String key){
        return wechatPro.getProperty(key);
    }
    
    
    private static Properties wechatPro = new Properties();
    
    private static final String WECHAT_CONFIG="config/wechatConfig.properties";
    static{
        try {
            InputStream inStream = WechatConfig.class.getClassLoader().getResourceAsStream(WECHAT_CONFIG);
            wechatPro.load(inStream);
            inStream.close();
        } catch (IOException e) {
         
        }
    }
    

}
